 <style>
     .ttl{width:70px;text-align:right;}
     .pop_cont_input{width:100%;}
     .pop_cont_input ul {width:100%;}
     .pop_cont_input ul li {width:25%;float:left;height:35px;}
     .pop_cont_input{line-height:30px;}
     .pop_cont_input input{pading:0px 5px;}
     .pop_cont_input select{height:28px;}
     .pop_cont .pop_cont_input li{margin: 0px 0px;}
     .pop_cont .pop_cont_input li .textbox{border:1px #d2d2d2 solid; width:120px; display:inline-block;}

     .pop_cont {
         background: white;
         min-width: 300px;
         height: auto;
         overflow: hidden;
         position: absolute;
         top: 2%;
         left: 50%;
         margin-left: -48%;
         border-radius: 5px 5px 0 0;
     }
     .pop_cont .btm_btn {padding:0px 0px;}
     .blank{width:100%;height:10px;overflow:hidden;}
.bixuan{color:red;}
 </style>
 <!--引入JS-->
<script type="text/javascript" src="/static/admin/js/ajaxfileupload.js?t=1"></script>
<link rel="stylesheet" type="text/css" href="/static/My97DatePicker/skin/WdatePicker.css" />
<script charset="utf-8" src="/static/My97DatePicker/WdatePicker.js"></script>
  
 
 <div class="pop_cont" style="width:96%;">
 <input type="hidden" value="<?php echo $id; ?>" id="editId" />
 <form autocomplete="off" action="#" id="myform">
 </form>
       <!--title-->
       <h3><?php echo $title;?><span class="falseBtn" style="color:red;float:right;font-size:18px;cursor:pointer;">X</span></h3>
       <!--content-->
       <div class="pop_cont_input">
        <ul>
         <li>
          <span class="ttl"><font class="bixuan">*</font>登录账号</span>
          <input type="text" name="e-uname" id="e-uname" value="<?=' '?>"  placeholder="登录账号" class="textbox" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;"  autocomplete="off" />
         </li>
         <li>
          <span class="ttl"><font class="bixuan">*</font>登录密码</span>
          <input type="password" name="e-pwd" id="e-pwd"  placeholder="请输入登录密码" class="textbox" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;"  autocomplete="off" />
          
         </li>
         <li>
          <span class="ttl"><font class="bixuan"></font>部门</span>
           <select name="e-firstDep" id="e-firstDep" class="select firstDept" style="width:80px;">
	       <option value="">--选择--</option>
	       <?php

	       foreach($FirstDepList as $key=>$val)
	   		{
	   		?>
	        <option value="<?php echo $val['id']; ?>" ><?php echo $val['depname'] ?></option>
		   <?php
	       }
       		?>
          </select>
         
         </li>
        
         <li>
          <span class="ttl"><font class="bixuan">*</font>角色</span>
           <select name="e-group" id="e-group" class="select">
	       <option value="">--选择--</option>
	       <?php
	       foreach($groupList as $key=>$val)
	   		{
				if($val['gname']=="普通用户")
				{
                ?>
                 <option value="<?php echo $val['id']; ?>"  selected ><?php echo $val['gname'] ?></option>
                <?php
				}else
				{
	   		?>
	        <option value="<?php echo $val['id']; ?>" <?php if($val['id']==$info['group']){ echo 'selected';} ?> ><?php echo $val['gname'] ?></option>
		   <?php
		    }
	       }
       		?>
      </select>
         </li>
      
         <li>
          <span class="ttl"><font class="bixuan">*</font>姓名</span>
          <input type="text" name="e-nickname" id="e-nickname" value="" placeholder="姓名" class="textbox" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;"  autocomplete="off" />
          
         </li>
         
          <li>
          <span class="ttl"><font class="bixuan">*</font>性别</span>
            <select name="e-sex" id="e-sex" class="select">
             <option value="1">男</option>
             <option value="0">女</option>
            </select>
         </li>   
        
         <li>
          <span class="ttl">出生年月</span>
          <input name="e-bday"  id="e-bday" class="Wdate textbox" placeholder="出生年月"  onfocus="WdatePicker({lang:'zh-cn'})" value="" size="12"  type="text" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;" >
         </li>

            <li>
                <span class="ttl">身高</span>
                <input name="e-height"  id="e-height"  placeholder="身高" value="" size="12"  type="text" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;" >
            </li>

            <li>
                <span class="ttl">体重</span>
                <input name="e-weight"  id="e-weight"  placeholder="体重"  value="" size="12"  type="text" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;" >
            </li>

            <li>
                <span class="ttl">支付宝姓名</span>
                <input name="e-alipay_name"  id="e-alipay_name"  placeholder="支付宝账号姓名"  value="" size="12"  type="text" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;" >
            </li>
            <li>
                <span class="ttl">支付宝账号</span>
                <input name="e-alipay_account"  id="e-alipay_account"  placeholder="支付宝账号"  value="" size="12"  type="text" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;" >
            </li>



            <li>
                <span class="ttl">身份证号</span>
                <input type="text" name="e-cid" id="e-cid" value="<?php echo $info['cid'];?>" placeholder="身份证号" class="textbox" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;"  autocomplete="off" />
            </li>
            <li>
                <span class="ttl"><font class="bixuan"></font>联系电话</span>
                <input type="text" name="e-phone" id="e-phone" value="<?php echo $info['phone'];?>" placeholder="联系电话" class="textbox" style="padding: 0 5px;font-size: 12px;border: 1px #139667 solid;vertical-align: middle;width:120px;"  />

            </li>
            <li>
                <span class="ttl"><font class="bixuan"></font>VIP</span>
                <select name="e-vip" id="e-vip" class="select">
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </li>

            <li style="width:100%;height:100px;">
          <span class="ttl">照片</span>
         <form id="jvForm" name="jvForm" style="display:inline-block;" action="/api/face/updateImage1" method="post" enctype="multipart/form-data">
            <input type="hidden" name="e-mpic" id="e-mpic" value="" />
              <a style="position:relative;display:block;width:100px;height:30px;background:#EEE;border:1px solid #999;text-align:center;line-height:30px;"  href="javascript:void(0);" >上传文件
                <input style="position:absolute;left:0;top:0;width:100px;height:30px;z-index:999;opacity:0;" onchange="uploadPic()" type="file" name="file" id="file"  />
                </a>
              <div id="updateimg"></div>
              </form>
         </li>
         <li style="width:100%;">
         <!--bottom:operate->button-->
	       <div class="btm_btn">
	        <input type="button" value="确认" class="input_btn trueBtn"/>
	        <input type="button" value="关闭" class="input_btn falseBtn"/>
	       </div>
         </li>
        </ul>
       </div>
     <div class="blank"></div>
 </div>
      <script>
      function uploadPic()
      {
   	
   		 $.ajaxFileUpload(
   		   {
	    		   	url: '/api/face/uploadImage1', //用于文件上传的服务器端请求地址
	    		   	secureuri: false, //是否需要安全协议，一般设置为false
	    		   	fileElementId: 'file', //文件上传域的ID
	    		   	dataType: 'text/plain', //返回值类型 一般设置为json
	    		   	success: function (data, status) //服务器成功响应处理函数
	    		   	{
	    		   
	    		   	 if(data.err==0)
	                   {
	                	   var img='<a href="'+data.data.pic+'" target="_blank"><img src="'+data.data.pic+'" style="width:60px;margin:5px;" /></a>';
	                   $("#updateimg").html(img);
	                   $("#e-mpic").val(data.data.pic);
	                   }
	    		   },
	    		   error: function (data, status, e)//服务器响应失败处理函数
	    		   {
	    		   	alert(e);
	    		   }
   		   }
   		 )
   		   return false;
   		   
      }
      $(function(){
	       $(".trueBtn").unbind().bind("click",function(){
	    	var that =this;
   		    var url="/admin/user/addData";
   		    var uname=$("#e-uname").val();
   		    var pwd=$("#e-pwd").val();
   		    var first_depid=$("#e-firstDep").val();
   		    var group=$("#e-group").val();
   		    var nickname=$("#e-nickname").val();
   		    var sex=$("#e-sex").val();
   		    var bday=$("#e-bday").val();
   		    var cid=$("#e-cid").val();
   		    var phone=$("#e-phone").val();

   		    var head=$("#e-mpic").val();
   		    var vip=$("#e-vip").val();

           var height=$("#e-height").val();
           var weight=$("#e-weight").val();
           var alipay_name=$("#e-alipay_name").val();
           var alipay_account=$("#e-alipay_account").val();

   		   
   		 if(uname=="")
		   {
		    	ErrTiShi("请输入登录账号");return false;
		   }
   		 var unameLen = uname.length;
  		 if(unameLen<4 || unameLen >20)
  		 {
  			ErrTiShi("登录账号长度不正确，请输入4-20位长度的字符串");return false;
  		 }
  		 if(pwd=="")
		 {
		    	ErrTiShi("请输入登录密码");return false;
		 }
  		 
  		 if(first_depid=="")
  		 {
  			ErrTiShi("请选择部门");return false;
  		 }
  		 if(group=="")
  	     {
  			ErrTiShi("请选择角色");return false;
  	     }
  		if(nickname=="")
        {
		    	ErrTiShi("请输入用户姓名");return false;
        }
  		 
   		
   		var nicknameLen = nickname.length;
  		if(nicknameLen<2 || nicknameLen >8)
        {
 			ErrTiShi("姓名长度不正确，请输入2-8位长度的字符串");return false;
        }
   		 
 		if(sex=="")
		{
		    	ErrTiShi("请选择性别");return false;
		}

   		    var param={
   		    	   uname:uname,
   				   nickname:nickname,
   				   pwd:pwd,
   				   first_depid:first_depid,
   				   group:group,
   				   phone:phone,
   				   head:head,
   				   sex:sex,
   				   cid:cid,
                    vip:vip,
                    bday:bday,
                    height:height,
                    weight:weight,
                    alipay_name:alipay_name,
                    alipay_account:alipay_account,
   				   sys_opt:'addData'//后台判断编辑操作
   		    };
			 AjaxRequest(url,param,function(data){
  			   if(data.err==0)
  			   {
  				   SuccessTiShi("操作成功");
  				   $(".pop_bg").fadeOut();
  				   $(".pop_bg").html('');
  				   myResearch();
  			   }
  			   else
  			   {
  				   ErrTiShi(data.msg);
  			   }
  		   	});
			 
		  });
		   //弹出：取消或关闭按钮
		   $(".falseBtn").unbind().bind("click",function(){
			 $(".pop_bg").fadeOut();
		   });
		   document.getElementById("myform").reset(); 
 	});
      </script>